import axios from './axios';
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));

export const getMenu = (param) => {
    return axios.request({
        url: '/api/students',
        method: 'post',
        data: param
    });
};

export const getData = () => {
    return axios.request({
        url: 'http://localhost:9000/api/students',
        method: 'get'
    });
};

export const getUser = (params) => {
    return axios.request({
        url: 'http://localhost:9000/api/students',
        method: 'get',
        params
    });
};

export const addUser = (data) => {
    return axios.request({
        url: 'http://localhost:9000/api/students',
        method: 'post',
        data
    });
};

export const editUser = (data) => {
    return axios.request({
        url: 'http://localhost:9000/api/students/{id}',
        method: 'post',
        data
    });
};

export const deleteUser = (data) => {
    return axios.request({
        url: 'http://localhost:9000/api/students/{id}',
        method: 'post',
        data
    });
};

// src/api/index.js
export * from './StudentList';
export * from './ClassList';
export * from './TaskList';